<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
    <style type="text/css">
        body, html, #allmap {
            width: 100%;
            height: 100%;
            overflow: hidden;
            margin: 0;
            font-family: "微软雅黑";
        }
    </style>
    <script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=kaLBv8Axey6j0ZRMAHaYUhGAKVq4KG9K"></script>
    <title>百度地图多个标注点沿折线的轨迹运动</title>
</head>
<body>
<div id="allmap"></div>
</body>
</html>
<script type="text/javascript">

    // $(document).ready(function () {
    //     $.ajax({
    //         url: 'http://ta.vipgz2.idcfengye.com/EPServer/servelt/web/cargo/FindAllTruckLocation?DHTG',
    //         type: 'get',
    //         dataType: 'json',
    //         crossDomain: true,
    //         success: function (data) {
    //             var rows = data.rows;
    //             lon = rows.longitude;
    //             lat = rows.latitude;
    //         }
    //     });
    // });
    lon = 116.363737;
    lat = 39.913607;

    // 百度地图API功能
    var map = new BMap.Map("allmap");
    map.centerAndZoom(new BMap.Point(116.404, 39.915), 12);
    map.enableScrollWheelZoom(true);
    map.addControl(new BMap.NavigationControl());
    map.addControl(new BMap.ScaleControl({anchor: BMAP_ANCHOR_TOP_LEFT}));
    map.addControl(new BMap.OverviewMapControl());
    map.addControl(new BMap.MapTypeControl());

	var pt = new BMap.Point(lon, lat);
	var myIcon = new BMap.Icon("truck.png", new BMap.Size(300,157));
	var marker2 = new BMap.Marker(pt,{icon:myIcon});  // 创建标注
	map.addOverlay(marker2);  // 将标注添加到地图中
</script>
